<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <title>服务商平台-新增商户</title>
    <link rel="icon" href="favicon.ico" type="image/x-icon"/>
    <!-- 当前页面样式 -->
    <link rel="stylesheet" href=<s:url value="/css/common.css"/>>
	<script type="text/javascript" src="<s:url value="/js/jquery-1.9.1.js" />"></script>
	<script type="text/javascript" src="<s:url value="/js/query_Address.js" />"></script>
	<script type="text/javascript" src="<s:url value="/js/jquery.validate.js" />"></script>
	<script type="text/javascript" src="<s:url value="/js/pwms.validate.js" />"></script>
	<script type="text/javascript" src="<s:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
	<script type="text/javascript" src="<s:url value="/dwr/engine.js"/>"></script>
	<script type='text/javascript' src='<s:url value="/dwr/interface/AddressQuery.js"/>'></script>
	<script type='text/javascript' src='<s:url value="/dwr/interface/BankQuery.js"/>'></script>
	<script type='text/javascript' src='<s:url value="/js/YLlightbox.js"/>'></script>
	<script type='text/javascript' src='<s:url value="/js/ajaxfileupload.js"/>'></script>
	<script type='text/javascript' src='<s:url value="/js/pageAjax.js"/>'></script>
	
	<!-- jQuery UI 插件 -->
	<link rel="stylesheet" href=<s:url value="/css/jquery.ui.all.css"/>>
	<script src=<s:url value="/js/ui/jquery.ui.core.js"/>></script>
	<script src=<s:url value="/js/ui/jquery.ui.widget.js"/>></script>
	<script src=<s:url value="/js/ui/jquery.ui.position.js"/>></script>
	<script src=<s:url value="/js/ui/jquery.ui.menu.js"/>></script>
	<script src=<s:url value="/js/ui/jquery.ui.autocomplete.js"/>></script>
	<link rel="stylesheet" href=<s:url value="/css/demos.css"/>>
	<style>
		.fieldError { color: red; text-align: left; }
		.error { float: none; color: red;  vertical-align: top;font-size: 11px;}
		.ui-autocomplete {
		max-height: 200px;
		overflow-y: auto;
		/* prevent horizontal scrollbar */
		overflow-x: hidden;
	}
	/* IE 6 doesn't support max-height
	 * we use height instead, but this forces the menu to always be this tall
	 */
	* html .ui-autocomplete {
		height: 100px;
	}
	</style>
</head>
<body>
<s:form id="dmerinfoForm" method="POST" action="/mer/editDirectMerComplete.ct" theme="simple">
<s:hidden id="isMid" name="merinfo.id" />
<s:hidden id="mer_status" name="merinfo.status" />
<s:hidden id="orgCodes"   value="%{#request.org}"/>
<s:hidden id="areaCode"  value="%{#request.areaCode}"/>
<s:hidden id="areaCityCode" value="%{#request.areaCityCode}"/>
<s:hidden id="roleType"  value="%{#request.roleType}"/>
<s:hidden id="groupCd" value="%{#request.groupCd}"/>
<table class="tb" style="width:100%">
    <tbody>
        <tr class="tb-line">
            <td class="tb-td" colspan="4" ><div class="tb-h3">驳回商户信息</div></td>
        </tr>
         
        <tr class="tb-line bg-gray">
            <td  align="right" class="tb-td"  ><div class="tb-h4">申请人：</div></td>
            <td class="tb-td"  colspan="3">
                <label class="tb-normal">  <s:property value="merinfo.recUpdOpr"/> 
                	<font color="red" style="margin-bottom: -20px; margin-left: 400px"><s:actionmessage/></font>
                </label>
            </td>
        </tr>
        <tr class="tb-line">
            <td class="tb-td" colspan="4"><div class="tb-h3"><font color="red">被驳回信息</font></div></td>
        </tr>
		<tr class="tb-line" >
            <td align="center" class="tb-td" colspan="4" style="padding: 0;">
                <table style="width: 100%" class="bg-gray"  >
                	<tr class="tb-line" align="center"> 
                		<td class="tb-td" style="width:15%"><b>审核员</b></td>
                		<td class="tb-td" style="width:65%"><b>驳回原因</b></td>
                		<td class="tb-td" style="width:20%"><b>驳回时间</b></td>
                	</tr>
               		<tr class="tb-line"  align="center">
               			<td class="tb-td"><s:property value="merinfo.mchtExtendInfo.backup1"/> </td>
               			<td class="tb-td"><s:property value="merinfo.mchtExtendInfo.backup3"/> </td>
               			<td class="tb-td"><s:property value="merinfo.mchtExtendInfo.backup4"/></td>
               		</tr>
                </table>
            </td>
        </tr>
        <tr class="tb-line">
            <td class="tb-td" colspan="4"><div class="tb-h3">基本信息</div></td>
        </tr>
		 
        <tr class="tb-line">
            <td align="right" class="tb-td" style="width:110px;">
                <div class="tb-h4">商户简称：</div>
            </td>
            <td class="tb-td" >
             	<label class="tb-input-lengthen">
                <s:textfield id="merName" name="merinfo.nameBusi" maxlength="20"/>
                </label><code class="asterisk">*</code><font id="checkName" color="red"></font><font id="rtName" color="red"></font>
            </td>
            <td align="right" class="tb-td" style="width:110px;">
                <div class="tb-h4">工商注册名称：</div>
            </td>
            <td class="tb-td" >
             	<label class="tb-input-lengthen">
                	 <s:textfield name="merinfo.name" maxlength="50"/>
				</label><code class="asterisk">*</code>
            </td>
        </tr>

        <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">商户注册地址：</div>
            </td>
            <td class="tb-td" >
            	<s:if test="#request.proName!=null ">
	             	<label class="tb-input-mini">
	                		<input   value="<s:property value="#request.proName"/>" style="background-color: lightgray;" readonly="readonly"/>
	                		<s:hidden name="merinfo.provCd" value="%{#request.areaCode}"/>
	             	</label>
             	</s:if>
                <label class="tb-select">
                	
                	<s:else>
                		<select id="provinces" name="merinfo.provCd" onchange="loadCity()"  class="queryWidth"  ></select>
                	</s:else>
                 	<input id="proCodeHidden"  type="hidden"  value="<s:property value="merinfo.provCd"/>"/>
                    <select id="citys" name="merinfo.cityCd" onchange="loadArea()" class="queryWidth"></select>
                    <input id="cityCodeHidden" type="hidden"  value="<s:property value="merinfo.cityCd"/>"/>
					<select id="areas" name="merinfo.areaCd"  ></select>
                    <input id="areaCodeHidden" type="hidden"  value="<s:property value="merinfo.areaCd"/>"/>
                </label><code class="asterisk">*</code>
            </td>
             <td align="right" class="tb-td">
                <div class="tb-h4">详细地址：</div>
            </td>
            <td class="tb-td" >
                <label class="tb-input-lengthen">
                	<s:textfield name="merinfo.regAddr" maxLength="30"/>
                </label><code class="asterisk">*</code>
            </td>
        </tr>
		 <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">法人代表：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-lengthen">
                	<s:textfield name="merinfo.certif" maxLength="15"/>
				</label><code class="asterisk">*</code>
            </td>
            <td align="right" class="tb-td">
                <div class="tb-h4">营业执照号码：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-lengthen">
                	<s:textfield name="merinfo.busiLiceNo" maxLength="19"/>
                </label><code class="asterisk">*</code>
            </td>
        </tr>
        <tr class="tb-line">
        	 <td    align="right" class="tb-td" >
                		 <div class="tb-h4">法人证件类型：</div>
            </td>
            <td class="tb-td" >
               <label class="tb-select">
               		<s:select id= "bhcertifType" name="merinfo.certifType" list="#request.certifType"></s:select>
                </label><code class="asterisk">*</code>
            </td>
            <td   align="right" class="tb-td" >
                <div class="tb-h4">法人证件号码：</div>
            </td>
            <td class="tb-td" >
                <label class="tb-input-lengthen">
					<s:textfield id="bhcertifNo" name="merinfo.certifNo" maxLength="20"/>
				</label><code class="asterisk">*</code>
            </td>
        </tr>
        <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">商户联系人：</div>
            </td>
            <td class="tb-td" >
                <label class="tb-input-lengthen">
                	<s:textfield name="merinfo.contactName" maxLength="20"/>
                </label><code class="asterisk">*</code>
            </td>
            <td  align="right" class="tb-td">
                <div class="tb-h4">手机号码：</div>
            </td>
            <td class="tb-td" >
                <label class="tb-input-lengthen">
                	<s:textfield name="merinfo.contactPhoneNo" maxLength="15"/>
                </label><code class="asterisk">*</code>
            </td>
        </tr>
        
        <tr class="tb-line">
			<td align="right" class="tb-td"><div class="tb-h4">营业起始时间：</div></td>
			<td class="tb-td"> 
				 <label class="tb-input-mini">
				 	<s:textfield  name="merinfo.terminfoRisk.AccpetStartTime"  onfocus="WdatePicker({dateFmt:'HHmm',readOnly:true,wdate:true,errDealMode:0});"  cssStyle="background-color:lightgray;" />
				 </label>
				<code class="asterisk">*</code>
			</td>
			<td align="right" class="tb-td"><div class="tb-h4">营业终止时间：</div></td>
			
			<td class="tb-td">
				 <label class="tb-input-mini">
				 	<s:textfield  name="merinfo.terminfoRisk.AccpetEndTime"  onfocus="WdatePicker({dateFmt:'HHmm',readOnly:true,wdate:true,errDealMode:0});"  cssStyle="background-color:lightgray;" />
				 </label>
				<code class="asterisk">*</code>
			</td>
		</tr>
		<tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">经营业务、范围：</div>
            </td>
            <td class="tb-td"   >
                <label class="tb-input-lengthen">
                	<s:textfield name="merinfo.busiMain" maxLength="30"/>
                </label><code class="asterisk">*</code>
            </td>
            <td align="right" class="tb-td">
                <div class="tb-h4">商户类型：</div>
            </td>
            <td class="tb-td" >
                <s:radio list="#{'0':'个体户','1':'企业' }" name="merinfo.nationCd" />
            </td>
        </tr>
        <tr class="tb-line">
           <td align="right" class="tb-td">
	            <div class="tb-h4">商户等级：</div>
	        </td>
	         <td class="tb-td"   >
	             <label class="tb-input-mini">
	                	<s:textfield name="merinfo.isGroup" value="F" readonly="true" cssStyle="background-color:lightgray;"/>
	               </label>
	          </td>
            <td align="right" class="tb-td">
                <div class="tb-h4">商户直间连：</div>
            </td>
			<td class="tb-td" >
				<%-- <s:radio name="merinfo.groupCD" list="#{  '1':'直联','0':'间联','2':'间联直营'  }" ></s:radio> --%>
				 <s:if test="#request.groupCd==\"1\"">
                		<s:radio name="merinfo.groupCD" list="#{ '1':'直联','0':'间联','2':'间联直营'  }"  value="1" disabled="true"></s:radio>
                	</s:if>
                	<s:elseif test="#request.groupCd==\"2\"">
                		<s:radio name="merinfo.groupCD" list="#{ '1':'直联','0':'间联','2':'间联直营'  }"  value="2" disabled="true"></s:radio>
                	</s:elseif>
                	<s:else>
                		<s:radio name="merinfo.groupCD" list="#{ '1':'直联','0':'间联','2':'间联直营'  }" value="0" disabled="true"></s:radio>
                	</s:else>
                	<s:hidden id="merGroupCdEdit" name="merinfo.groupCD" value="%{#request.groupCd}"/>
			</td>
        </tr>
		<s:if test="(#request.roleType==\"10\" || #request.roleType==\"18\") &&#request.groupCd==\"2\"">
			<tr class="tb-line">
				<td align="right" class="tb-td">
					<div class="tb-h4">发展人：</div>
				</td>
				<td class="tb-td">
					<label class="tb-select">
						<s:select id="developPerson" name="merinfo.mchtExtendInfo.developPerson" cssClass="queryWidth" list="#request.developPersonMap" listKey="key" listValue="value" headerKey="" headerValue="--请选择--"></s:select>
					</label>
					<label class="tb-input-normal"><s:textfield id="inputAccountNo"  placeholder="请输入发展人账号"   /> </label>
				</td>
				<td align="right" class="tb-td" >
					<div class="tb-h4">所属机构：</div>
				</td>
				<td class="tb-td" >
					<label class="tb-select">
						<s:select cssClass="queryWidth" name="merinfo.bankBelongCd" id="orgCode"
							list="#request.orgList" listKey="insIdCd" listValue="insName" />
					</label>	
					<label class="tb-select">
						<s:select cssClass="queryWidth" name="merinfo.ext1" id="oneagentid"
							list="#request.orgMainList" listKey="id" listValue="realName" headerKey="" headerValue="--请选择--"/>
					</label>	
					<label class="tb-input-normal"><s:textfield id="inputOneOrgName" placeholder="请输入机构名称"/></label>
					<font color="red">*</font>
				</td>
			</tr></s:if>
			<s:if test="#request.groupCd==\"2\"">
				<tr class="tb-line">
					<td align="right" class="tb-td">身份证是否长期：</td>
					<td class="tb-td" colspan="3">
						<s:radio id="certifValidit" list="#{'0':'长期','1':'非长期' }" name="merinfo.mchtExtendInfo.certifValidity" ></s:radio>&nbsp;&nbsp;
						<label class="tb-input-normal">
							<s:textfield id="certifStartDate" name="merinfo.mchtExtendInfo.certifStartDate" maxLength="10"/>
						</label>
						-
						<label class="tb-input-normal">
							<s:textfield id="certifEndDate" name="merinfo.mchtExtendInfo.certifEndDate" maxLength="10"/>
						</label>
					</td>
				</tr>
				<tr class="tb-line">
					<td align="right" class="tb-td">营业执照有效期：</td>
					<td class="tb-td" colspan="3">
						<s:radio id="busiLiceValidit" list="#{'0':'长期','1':'非长期' }" name="merinfo.mchtExtendInfo.busiLiceValidity" ></s:radio>&nbsp;&nbsp;
						<label class="tb-input-normal">
							<s:textfield id="busiLiceStartDate" name="merinfo.mchtExtendInfo.busiLiceStartDate" maxLength="10"/>
						</label>
						-
						<label class="tb-input-normal">
							<s:textfield id="busiLiceEndDate" name="merinfo.mchtExtendInfo.busiLiceEndDate" maxLength="10"/>
						</label>
					</td>
				</tr>
				<s:if test="#request.roleType==\"03\" || #request.roleType==\"16\"">
					<tr class="tb-line">
						<td align="right" class="tb-td">拓展人：</td>
						<td class="tb-td" colspan="3">
						<label class="tb-input-normal">
							<s:textfield id="backup5" name="merinfo.mchtExtendInfo.backup5" maxlength="20"/>
						</label>	
						</td>
					</tr>
				</s:if>
			</s:if>
        <tr class="tb-line">
        	 <td align="right" class="tb-td">
                <div class="tb-h4">备注：</div>
            </td>
            <td class="tb-td"  colspan="3" >
                <label class="tb-input-lengthen">
                	 <s:textarea name="merinfo.ext2" onpropertychange="textCounter(this,30);" oninput="textCounter(this,30);"  cssStyle="width:700px;height:60px;border:1px solid #e2dfdf;"/>
                </label>
            </td>
        </tr>
    </tbody>
</table>

<div class="tab-body" id="tabBody" style="width:100%">
    <div class="tab-title bg-gray" style="width:100%">
        <div class="tb-title active">结算信息</div>
        <div class="tb-title">终端信息</div>
        <div class="tb-title">产品开通</div>
        <div class="tb-title">资料上传</div>
    </div>
    
    <div class="tab-cnt" style="width:100%;">
        
        <table class="tb" style="width:100%;display: block;">
            <tbody >
                <tr class="tb-line" >
                	<td class="tb-td" colspan="4"><div class="tb-h3">商户结算规则</div></td>
                </tr>
                <%-- <tr class="tb-line" style="width:100%">
                   <td width="7%" style="min-width: 110px" align="right" class="tb-td"  >
                        <div class="tb-h4">账户属性：</div>
                    </td>
                    <td class="tb-td" colspan="3"  >
                        <label class="tb-input-lengthen">
                        	<s:radio list="${'01':'','':'' }"></s:radio>
                        </label><code class="asterisk">*</code>
                    </td>
                     
                </tr> --%>
                <tr class="tb-line" style="width:100%"   >
				    	<td align="right" class="tb-td" style="width:110px;">
				        	<div class="tb-h4">账户属性：</div>
			            </td>
			            <td class="tb-td"  >
			             	<s:radio id="approvalUserName" type="radio" list="#{'0':'私人账户','1':'企业账户' }" name="merinfo.approvalUserName" value="0" ></s:radio>
							<font color="red">*</font>
						 </td>
						<td align="left" class="tb-td"  colspan="2">
	                         <font color="red">提示：企业账户是否法人结算和非法人身份证号可忽略不填；<br/>私人账户若为非法人结算，则必须填写非法人身份证号码和添加非法人结算授权书(图片)</font>
	                    </td>
				</tr>
               <tr class="tb-line" id="isPrivate"  >
					<td align="right" class="tb-td" style="width:110px;">
				        	<div class="tb-h4">是否法人结算：</div>
			            </td>
			            <td class="tb-td" >
			            	<label class="tb-select">
			             	<select id="dvpBy" name="merinfo.dvpBy">
									<option value='1'>否</option>
									<option value='0'>是</option>
							</select>
							</label>
							<font color="red">*</font>
						 </td>
						 
				    	<td align="right" class="tb-td" style="width:110px;">
				        	<div class="tb-h4" id="ff">非法人身份证号：</div>
			            </td>
			            <td class="tb-td" id="abcd">
			             	 <label  class="tb-input-lengthen">
			             		<s:textfield  id="stlm"  maxlength="20" name="merinfo.stlmWayDesc" cssClass="queryWidth" /> 
			             	</label>
			             	<font color="red"><span id="xh">*</span></font> 
			            </td>
				</tr>
				 <tr class="tb-line" style="width:100%">
                   <td width="7%" style="min-width: 110px" align="right" class="tb-td"  >
                        <div class="tb-h4">账户名称：</div>
                    </td>
                    <td class="tb-td"   >
                        <label class="tb-input-lengthen">
                        	<s:textfield name="merinfo.bankAccount.name" maxLength="30"/>
                        </label><code class="asterisk">*</code>
                    </td>
                    <td align="right" class="tb-td"  >
                        <div class="tb-h4">账户账号：</div>
                    </td>
                    <td class="tb-td"   >
                        <label class="tb-input-lengthen">
                        	<s:textfield name="merinfo.bankAccount.account" maxLength="30"/>
                        </label><code class="asterisk">*</code>
                    </td>
                </tr>
                 <tr class="tb-line" style="width:100%">
                   <td width="7%" style="min-width: 110px" align="right" class="tb-td"  >
                        <div class="tb-h4">开户行：</div>
                    </td>
                    <td class="tb-td"   >
                        <%-- <label class="tb-input-lengthen">
                       		<s:textfield id="aaa" name="merinfo.bankAccount.bankName" maxLength="50" readonly="true" cssStyle="background-color:lightgray;"/>
                        </label><code class="asterisk">*</code>
                        <input   type="button"  onclick="showPosInfoWindow()" value="选择" /> --%>
                        <span><input type="hidden" value="<s:property value="#request.bMapToList"/>" id="bankListHidden">
						<input id="tags" style="width:150px" placeholder="输入银行">-<s:textfield id="aaa" name="merinfo.bankAccount.bankName"   placeholder="输入支行" style="width:250px" /></span><code class="asterisk">*</code>
                    </td>
                    <td align="right" class="tb-td"  >
                        <div class="tb-h4"><!-- 开户行支付系统行号 -->联行号：</div>
                    </td>
                    <td class="tb-td"   >
                        <label class="tb-input-lengthen">
                        	<s:textfield id="bbb" name="merinfo.bankAccount.bankCode" maxLength="12" readonly="true" cssStyle="background-color:lightgray;"/>
                        </label><code class="asterisk">*</code>
                    </td>
                </tr>


            </tbody>
        </table>
        <table class="tb" id="posTable" style="display: none;">
            <tbody>
                 <tr class="tb-line" >
                    <td class="tb-td" colspan="4">
                        <div class="tb-h3">终端信息 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>
                        </div>
                        <div style="padding-left: 30px;">
                        	选择装机区域：
                        	<s:select id="chooseProvice" name="provice32" listKey="key" listValue="value"   list="#request.provinesMap"  headerKey="" headerValue="---请选择---" ></s:select>
                        	- <s:select id="chooseCity" list="#{'':'请选择' }"   name="merinfo.ucBccd"/>
		      				<%-- - <s:select id="chooseArea" list="#{'':'请选择' }"   name="merinfo.ucBccd"/> --%> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
		      				<font color="red">提示：请正确选择装机地址，风控审核会根据所选区域判断是否正确！</font>
                        </div>
                        <!--   受理市场运营角色添加机具产权属性 -->
                      <s:if test="#request.groupCd==\"2\"">
                        <br/><div style="padding-left: 30px;"> 机具产权：
                        <label class="tb-input-lengthen">
                        	 <s:select name="merinfo.mchtExtendInfo.termProperty" list="#{'0':'免投','1':'押金','2':'销售' }" value="0"></s:select>
						</label><code class="asterisk">*</code>
						</div>
                      </s:if>
                    </td>
                </tr>
                <tr><td style="height: 30px;" colspan="4" align="center"><b>添加终端信息</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<input id="terminalDiv" type="button"  value=" 添加终端 "/> </td> 
				</tr>
				<s:iterator value="merinfo.terminfoList" var="terminfo" status="stat">
					<tr class="tb-line">
						<td  style="width: 110px" align="right" class="tb-td">
	                        <div class="tb-h4">终端类型：</div>
	                        
	                    </td>
	                    <td class="tb-td" >
	                        <label class="tb-input-lengthen"> 
	                        	 <s:select name="merinfo.terminfoList[%{#stat.index}].TermTp" list="#request.posType" listKey="key" listValue="value"  />
							</label><code class="asterisk">*</code>
	                    </td>
	                	 <td  style="width: 110px" align="right" class="tb-td">
	                        <div class="tb-h4">终端接入方式：</div>
	                    </td>
	                    <td class="tb-td" >
	                        <label class="tb-select">
	                          <s:radio name="merinfo.terminfoList[%{#stat.index}].TmnlIntype" list="#{'0':'无线(GPRS)','1':'有线(拨号)' }" ></s:radio>
	                        </label><code class="asterisk">*</code>
	                    </td>
	                   
	                </tr>
	                <tr class="tb-line">
	                	<%-- <td style="width: 110px" align="right" class="tb-td" >
	                        <div class="tb-h4">押金金额：</div>
	                    </td>
	                    <td class="tb-td">
	                        <label class="tb-input-normal">
	                        	<s:textfield name="merinfo.terminfoList[%{#stat.index}].TmnlMoney"  maxLength="10"/>
	                        </label>
	                        <code class="asterisk">*</code>
	                    </td> --%>
	                    <td style="width: 110px" align="right" class="tb-td">
	                        <div class="tb-h4">装机地址：</div>
	                    </td>
	                    <td class="tb-td" colspan="3">
	                        <label class="tb-input-lengthen">
	                        	<s:textfield name="merinfo.terminfoList[%{#stat.index}].Installlocation" maxLength="30"/>
	                        </label>
	                        <code class="asterisk">*</code>
	                        <s:if test="#stat.index>0">
	                        	<input id='' type='button' onclick='deleteRows(this)'  value=' 删    除 'style='magin-left:30px;'/>
	                        </s:if>
	                    </td>
	                    
	                </tr>
				</s:iterator>
				 
            </tbody>
        </table>
        
         <table class="tb" style="display: none;">
            <tbody>
                <tr class="tb-line">
                    <td class="tb-td" colspan="4">
                        <div class="tb-h3">产品开通</div>
                    </td>
                </tr>
                <tr class="tb-line">
                    <td width="10%" style="min-width: 130px" align="right" class="tb-td">
                        <div class="tb-h4">产品信息选择：</div>
                    </td>
                    <td  align="left" class="tb-td"   colspan="3"> 
                     
                    	<s:checkboxlist id="productCodeLen" list="#request.product" name="merinfo.productCode"  value="merinfo.productCode" />
                    	<code class="asterisk">*</code><font id="isError" color="red"></font>
                    </td>
                </tr>
				 <tr class="tb-line">
                    <td width="10%" style="min-width: 130px" align="right" class="tb-td">
                        <div class="tb-h4">POS功能选择：</div>
                    </td>

                    <td  align="left" class="tb-td"  colspan="3">
                          <s:checkboxlist id="posFun" disabled="true" list="#request.posFunction" name="merinfo.productBean.transCd"    value="merinfo.productStrs" />
                    </td>
                </tr>
                <tr class="tb-line">
                    <td width="10%" style="min-width: 130px" align="right" class="tb-td">
                        <div class="tb-h4"><font color="red">T+1</font>借记卡手续费：</div>
                    </td>
                    <td  align="left" class="tb-td" >
                    		<label class="tb-input-mini">
                           	 	<s:textfield id="feePercent0" name="merinfo.fee[0].mchtFeePercent" />
                           	 </label>%<span></span> -
                           	 <label class="tb-input-mini">
                           	 <s:textfield id="feePctMax0" name="merinfo.fee[0].mchtFeePctMax" />
                           	 </label>封顶<span></span> <code class="asterisk">*</code>
                    </td>
                    <td width="10%" style="min-width: 130px" align="right" class="tb-td">
                        <div class="tb-h4"><font color="red">T+0</font>借记卡手续费：</div>
                    </td>
					<td  align="left" class="tb-td" >
						<label class="tb-input-mini">
							<s:textfield id="feePercent1" name="merinfo.fee[2].mchtFeePercent" />
						</label>%<span></span> -
						<label class="tb-input-mini">
							<s:textfield id="feePctMax1" name="merinfo.fee[2].mchtFeePctMax"/>
						</label><span></span>封顶 <code class="asterisk">*</code>
						<span id="serviceFee" style="display:none">
							<span class="tb-h4">代付服务费：</span>
								<label class="tb-input-mini">
									<s:textfield id="feeAPerchent1" name="merinfo.fee[2].mchtAFeePercent" />
								</label>%
						</span>
					</td>
                </tr>
                <tr class="tb-line" id="creditCardtr">
                    <td width="10%" style="min-width: 130px" align="right" class="tb-td">
                        <div class="tb-h4"><font color="red">T+1</font>贷记卡手续费：</div>
                    </td>
                    <td  align="left" class="tb-td"  >
                    	 <label class="tb-input-mini">
                           	<s:textfield id="feePercent2" name="merinfo.fee[1].mchtFeePercent" />
                         </label>%<span></span> -
                         <label class="tb-input-mini">
                           	<s:textfield id="feePctMax2"  name="merinfo.fee[1].mchtFeePctMax" value="0"  readonly="true" cssStyle="background-color:lightgray;"/>
                           	</label>封顶 
                           	<code class="asterisk">*</code>
                    </td>
                    <td width="10%" style="min-width: 130px" align="right" class="tb-td">
                        <div class="tb-h4"><font color="red">T+0</font>贷记卡手续费：</div>
                    </td>
                     <td  align="left" class="tb-td"  >
                    	 <label class="tb-input-mini">
                           	<s:textfield id="feePercent3" name="merinfo.fee[3].mchtFeePercent" />
                         </label>%<span></span> -
                         <label class="tb-input-mini">
                           	<s:textfield id="feePctMax3"  name="merinfo.fee[3].mchtFeePctMax"  value="0"  readonly="true" cssStyle="background-color:lightgray;" />
                           	</label>封顶 
                           	<code class="asterisk">*</code>
                    </td>
                </tr>
                 <tr class="tb-line" id="mccTr">
                    <td width="10%" style="min-width: 130px" align="right" class="tb-td">
                        <div class="tb-h4">MCC选择：</div>
                    </td>
                    <td  align="left" class="tb-td"  colspan="3" >
                    	<span>
                    	<input type="hidden" value="<s:property value="#request.mccMapToList"/>" id="mccListHidden">
                    	<!-- <input id="mccBtn" type="button"  value="去选择"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -->
                    	<s:hidden id="showMccCode" name="merinfo.upMccCd"  />
                    	<%-- <input id="showMccName" name="mccNameValidate"  value="<s:property value="#request.mccReq"/>" readonly="readonly"  style="background-color:lightgray; width:500px;height:20px;"/> --%>
                    	<input id="showMccName" name="mccNameValidate"  placeholder="输入行业" style="width:300px;" value="<s:property value="#request.mccReq"/>" onblur="checkMccCd()"/>
                    	</span>	<code class="asterisk">*</code>
                    </td>
                </tr>
                <tr class="tb-line">
                	 <td  class="tb-td" align="left" colspan="4">
                	 	<font color="green">1.&nbsp;&nbsp;产品开通T+1必选;<br/> 
                	 						2.&nbsp;&nbsp;T+1借记卡手续费封顶最低18; <br/>
                	 						3.&nbsp;&nbsp;若选择T+0，则T+0借记卡手续费、贷记卡手续费必填; <br/>
                	 						4.&nbsp;&nbsp;封顶值为0，则表示无封顶上限;</font>
                	 </td>
                </tr>
                <tr class="tb-line"  style="display: none;" >
                    <td width="10%" style="min-width: 130px" align="right" class="tb-td">
                        <div class="tb-h4">T+0服务费：</div>
                    </td>
                    <td  align="left" class="tb-td" style="padding-left: 15px;">
                    	<label class="tb-input-mini">
                           	 <s:textfield id="feePercent4" name="merinfo.fee[4].mchtFeePercent" value="0" readonly="true"   />%
                        </label><span></span> -
                        <label class="tb-input-mini">
                           	<s:textfield id="feePctMax4" name="merinfo.fee[4].mchtFeePctMax" value="0" readonly="true"  />
						</label><span></span>封顶 <span></span>
                           	<code class="asterisk">提示：0表示不收取</code>
                    </td>
                </tr>

            </tbody>
        </table>
		<table class="tb tb-pic YLlightbox" style="display: none;">
            <tbody>
                <tr class="tb-line">
                    <td class="tb-td" colspan="6">
                        <div class="tb-h3"><font color="red">提示：带&nbsp;*&nbsp;为必传项！若为非法人结算，则需上传非法人身份证图片！</font> </div>
                    </td>
                </tr>

                <tr class="tb-line">
                    <td width="3%" class="tb-td"></td>
                    <td width="20%" style="min-width: 240px" class="tb-td">
                        <div class="pic-uploading">
                            <p>营业执照照片</p>
                            <input  type="file" name="file" id="imgOne" onchange="uploadImg(this.id,'00');"  accept="image/*" capture="camera" />
                            <s:hidden id="imgOneId" name="merinfo.pictrueList[0].Url" />
                            <a rel="YLlightbox"  href="<s:if test="merinfo.pictrueList[0].Url!=null"><s:property value="merinfo.pictrueList[0].Url"/></s:if>" style="<s:if test="merinfo.pictrueList[0].Url!=null">display:block;</s:if>">  
                                <img src="<s:if test="merinfo.pictrueList[0].Url!=null"><s:property value="merinfo.pictrueList[0].Url"/></s:if>" />
                            </a>
                            <i class="delete-pic" style="<s:if test="merinfo.pictrueList[0].Url!=null">display:inline;</s:if>"></i>
                        </div>
                        <div class="tb-normal" id="divOne">请上传营业执照照片<code class="asterisk">*</code></div>
                    </td>
                    <td width="20%" style="min-width: 240px" class="tb-td">
                        <div class="pic-uploading" id="div1">
                            <p>法人身份证正面照片</p>
                            <input type="file" name="file"id="imgTwo"  onchange="uploadImg(this.id,'01');"  accept="image/*" capture="camera" />
                            <s:hidden id="imgTwoId" name="merinfo.pictrueList[1].Url" />
                            <a rel="YLlightbox"  href="<s:if test="merinfo.pictrueList[1].Url!=null"><s:property value="merinfo.pictrueList[1].Url"/></s:if>" style="<s:if test="merinfo.pictrueList[1].Url!=null">display:block;</s:if>">  
                                <img src="<s:if test="merinfo.pictrueList[1].Url!=null"><s:property value="merinfo.pictrueList[1].Url"/></s:if>" />
                            </a>
                            <i class="delete-pic" style="<s:if test="merinfo.pictrueList[1].Url!=null">display:inline;</s:if>"></i>
                        </div>
                        <div class="tb-normal" id="divTwo">请上传法人身份证正面照片<code class="asterisk">*</code></div>
                    </td>
                    <td width="20%" style="min-width: 240px" class="tb-td">
                        <div class="pic-uploading">
                            <p>法人身份证反面照片</p>
                            <input type="file" name="file" id="imgThree" onchange="uploadImg(this.id,'02');" accept="image/*" capture="camera" />
                            <s:hidden id="imgThreeId" name="merinfo.pictrueList[2].Url" />
                            <a rel="YLlightbox"  href="<s:if test="merinfo.pictrueList[2].Url!=null"><s:property value="merinfo.pictrueList[2].Url"/></s:if>" style="<s:if test="merinfo.pictrueList[2].Url!=null">display:block;</s:if>">  
                                <img src="<s:if test="merinfo.pictrueList[2].Url!=null"><s:property value="merinfo.pictrueList[2].Url"/></s:if>" />
                            </a>
                            <i class="delete-pic" style="<s:if test="merinfo.pictrueList[2].Url!=null">display:inline;</s:if>"></i>
                        </div>
                        <div class="tb-normal" id="divThree">请上传法人身份证反面照片<code class="asterisk">*</code></div>
                    </td>
                    <td width="20%" class="tb-td">
                    	 <div class="pic-uploading">
                            <p>结算银行卡照片</p>
                            <input type="file" name="file" id="imgFour" onchange="uploadImg(this.id,'03');" accept="image/*" capture="camera" />
                            <s:hidden id="imgFourId" name="merinfo.pictrueList[3].Url" />
                            <a rel="YLlightbox"  href="<s:if test="merinfo.pictrueList[3].Url!=null"><s:property value="merinfo.pictrueList[3].Url"/></s:if>" style="<s:if test="merinfo.pictrueList[3].Url!=null">display:block;</s:if>">  
                                <img src="<s:if test="merinfo.pictrueList[3].Url!=null"><s:property value="merinfo.pictrueList[3].Url"/></s:if>" />
                            </a>
                            <i class="delete-pic" style="<s:if test="merinfo.pictrueList[3].Url!=null">display:inline;</s:if>"></i>
                        </div>
                        <div class="tb-normal" id="divFour">请上传结算银行卡照片<code class="asterisk">*</code></div>
                    </td>
                </tr>

                <tr class="tb-line">
                    <td class="tb-td"></td>
                    <td class="tb-td">
                        <div class="pic-uploading">
                            <p>门头照照片</p>
                            <input type="file" name="file" id="imgFive" onchange="uploadImg(this.id,'04');" accept="image/*" capture="camera" />
                            <s:hidden id="imgFiveId" name="merinfo.pictrueList[4].Url" />
                            <a rel="YLlightbox"  href="<s:if test="merinfo.pictrueList[4].Url!=null"><s:property value="merinfo.pictrueList[4].Url"/></s:if>" style="<s:if test="merinfo.pictrueList[4].Url!=null">display:block;</s:if>">  
                                <img src="<s:if test="merinfo.pictrueList[4].Url!=null"><s:property value="merinfo.pictrueList[4].Url"/></s:if>" />
                            </a>
                            <i class="delete-pic" style="<s:if test="merinfo.pictrueList[4].Url!=null">display:inline;</s:if>"></i>
                        </div>
                        <div class="tb-normal" id="divFive">请上传门头照照片<code class="asterisk">*</code></div>
                    </td>
                    <td class="tb-td">
                        <div class="pic-uploading">
                            <p>收银台照片</p>
                            <input type="file" name="file" id="imgSix" onchange="uploadImg(this.id,'05');" accept="image/*" capture="camera" />
                            <s:hidden id="imgSixId" name="merinfo.pictrueList[5].Url" />
                            <a rel="YLlightbox"  href="<s:if test="merinfo.pictrueList[5].Url!=null"><s:property value="merinfo.pictrueList[5].Url"/></s:if>" style="<s:if test="merinfo.pictrueList[5].Url!=null">display:block;</s:if>">  
                                <img src="<s:if test="merinfo.pictrueList[5].Url!=null"><s:property value="merinfo.pictrueList[5].Url"/></s:if>" />
                            </a>
                            <i class="delete-pic" style="<s:if test="merinfo.pictrueList[5].Url!=null">display:inline;</s:if>"></i>
                        </div>
                        <div class="tb-normal" id="divSix">请上传收银台照片<code class="asterisk">*</code></div>
                    </td>
                    <td class="tb-td">
                        <div class="pic-uploading">
                            <p>经营场所照片</p>
                            <input type="file" name="file" id="imgSeven" onchange="uploadImg(this.id,'06');" accept="image/*" capture="camera" />
                            <s:hidden id="imgSevenId" name="merinfo.pictrueList[6].Url" />
                            <a rel="YLlightbox"  href="<s:if test="merinfo.pictrueList[6].Url!=null"><s:property value="merinfo.pictrueList[6].Url"/></s:if>" style="<s:if test="merinfo.pictrueList[6].Url!=null">display:block;</s:if>">  
                                <img src="<s:if test="merinfo.pictrueList[6].Url!=null"><s:property value="merinfo.pictrueList[6].Url"/></s:if>" />
                            </a>
                            <i class="delete-pic" style="<s:if test="merinfo.pictrueList[6].Url!=null">display:inline;</s:if>"></i>
                        </div>
                        <div class="tb-normal" id="divSeven">请上传经营场所照片<code class="asterisk">*</code></div>
                    </td>
                    <td class="tb-td">
                        <div class="pic-uploading">
                            <p>商户协议电子稿照片</p>
                            <input type="file" name="file" id="imgEight" onchange="uploadImg(this.id,'07');" accept="image/*" capture="camera" />
                           <s:hidden id="imgEightId" name="merinfo.pictrueList[7].Url" />
                            <a rel="YLlightbox"  href="<s:if test="merinfo.pictrueList[7].Url!=null"><s:property value="merinfo.pictrueList[7].Url"/></s:if>" style="<s:if test="merinfo.pictrueList[7].Url!=null">display:block;</s:if>">  
                                <img src="<s:if test="merinfo.pictrueList[7].Url!=null"><s:property value="merinfo.pictrueList[7].Url"/></s:if>" />
                            </a>
                            <i class="delete-pic" style="<s:if test="merinfo.pictrueList[7].Url!=null">display:inline;</s:if>"></i>
                        </div>
                        <div class="tb-normal" id="divEight">请上传商户协议电子稿照片<code class="asterisk">*</code></div>
                    </td>
                </tr>

                <tr class="tb-line">
                    <td class="tb-td"></td>
                    <td class="tb-td">
                        <div class="pic-uploading">
                            <p>手持身份证照片</p>
                            <input type="file" name="file" id="imgNine" onchange="uploadImg(this.id,'08');" accept="image/*" capture="camera" />
                           <s:hidden id="imgNineId" name="merinfo.pictrueList[8].Url" />
                            <a rel="YLlightbox"  href="<s:if test="merinfo.pictrueList.size()>8"><s:property value="merinfo.pictrueList[8].Url"/></s:if>" style="<s:if test="merinfo.pictrueList.size()>8">display:block;</s:if>">  
                                <img src="<s:if test="merinfo.pictrueList[8].Url!=null"><s:property value="merinfo.pictrueList[8].Url"/></s:if>" />
                            </a>
                            <i class="delete-pic" style="<s:if test="merinfo.pictrueList.size()>8">display:inline;</s:if>"></i>
                        </div>
                        <div class="tb-normal" id="divNine">请上传手持身份证照片</div>
                    </td>
                     <td class="tb-td">
                        <div class="pic-uploading">
                            <p>备注2</p>
                            <input type="file" name="file" id="imgTen" onchange="uploadImg(this.id,'09');" accept="image/*" capture="camera" />
                           <s:hidden id="imgTenId" name="merinfo.pictrueList[9].Url" />
                            <a rel="YLlightbox"  href="<s:if test="merinfo.pictrueList.size()>9"><s:property value="merinfo.pictrueList[9].Url"/></s:if>" style="<s:if test="merinfo.pictrueList.size()>9">display:block;</s:if>">  
                                <img src="<s:if test="merinfo.pictrueList[9].Url!=null"><s:property value="merinfo.pictrueList[9].Url"/></s:if>" />
                            </a>
                            <i class="delete-pic" style="<s:if test="merinfo.pictrueList.size()>9">display:inline;</s:if>"></i>
                        </div>
                        <div class="tb-normal" id="divTen">请上传备注2照片</div>
                    </td>
                    <td class="tb-td">
                        <div class="pic-uploading">
                            <p>备注3</p>
                            <input type="file" name="file" id="imgEleven" onchange="uploadImg(this.id,'10');" accept="image/*" capture="camera" />
                           <s:hidden id="imgElevenId" name="merinfo.pictrueList[10].Url" />
                            <a rel="YLlightbox"  href="<s:if test="merinfo.pictrueList.size()>10"><s:property value="merinfo.pictrueList[10].Url"/></s:if>" style="<s:if test="merinfo.pictrueList.size()>10">display:block;</s:if>">  
                                <img src="<s:if test="merinfo.pictrueList[10].Url!=null"><s:property value="merinfo.pictrueList[10].Url"/></s:if>" />
                            </a>
                            <i class="delete-pic" style="<s:if test="merinfo.pictrueList.size()>10">display:inline;</s:if>"></i>
                        </div>
                        <div class="tb-normal" id="divEleven">请上传备注3照片</div>
                    </td>
                    <td class="tb-td">
                        <div class="pic-uploading">
                            <p>备注4</p>
                            <input type="file" name="file" id="imgTwelve" onchange="uploadImg(this.id,'11');" accept="image/*" capture="camera" />
                           <s:hidden id="imgTwelveId" name="merinfo.pictrueList[11].Url" />
                            <a rel="YLlightbox"  href="<s:if test="merinfo.pictrueList.size()>11"><s:property value="merinfo.pictrueList[11].Url"/></s:if>" style="<s:if test="merinfo.pictrueList.size()>11">display:block;</s:if>">  
                                <img src="<s:if test="merinfo.pictrueList[11].Url!=null"><s:property value="merinfo.pictrueList[11].Url"/></s:if>" />
                            </a>
                            <i class="delete-pic" style="<s:if test="merinfo.pictrueList.size()>11">display:inline;</s:if>"></i>
                        </div>
                        <div class="tb-normal" id="divTwelve">请上传备注4照片</div>
                    </td>
                </tr>
                 <tr class="tb-line">
                    <td class="tb-td"></td>
                    <td class="tb-td">
                        <div class="pic-uploading">
                            <p>备注5</p>
                            <input type="file" name="file" id="imgThirteen" onchange="uploadImg(this.id,'12');" accept="image/*" capture="camera" />
                           <s:hidden id="imgThirteenId" name="merinfo.pictrueList[12].Url" />
                            <a rel="YLlightbox"  href="<s:if test="merinfo.pictrueList.size()>12"><s:property value="merinfo.pictrueList[12].Url"/></s:if>" style="<s:if test="merinfo.pictrueList.size()>12">display:block;</s:if>">  
                                <img src="<s:if test="merinfo.pictrueList[12].Url!=null"><s:property value="merinfo.pictrueList[12].Url"/></s:if>" />
                            </a>
                            <i class="delete-pic" style="<s:if test="merinfo.pictrueList.size()>12">display:inline;</s:if>"></i>
                        </div>
                        <div class="tb-normal" id="divThirteen">请上传备注5照片</div>
                    </td>
                     <td class="tb-td">
                        <div class="pic-uploading">
                            <p>备注6</p>
                            <input type="file" name="file" id="imgFourteen" onchange="uploadImg(this.id,'13');" accept="image/*" capture="camera" />
                           <s:hidden id="imgFourteenId" name="merinfo.pictrueList[13].Url" />
                            <a rel="YLlightbox"  href="<s:if test="merinfo.pictrueList.size()>13"><s:property value="merinfo.pictrueList[13].Url"/></s:if>" style="<s:if test="merinfo.pictrueList.size()>13">display:block;</s:if>">  
                                <img src="<s:if test="merinfo.pictrueList[13].Url!=null"><s:property value="merinfo.pictrueList[9].Url"/></s:if>" />
                            </a>
                            <i class="delete-pic" style="<s:if test="merinfo.pictrueList.size()>13">display:inline;</s:if>"></i>
                        </div>
                        <div class="tb-normal" id="divFourteen">请上传备注6照片</div>
                    </td>
                    <td class="tb-td">
                        <div class="pic-uploading">
                            <p>备注7</p>
                            <input type="file" name="file" id="imgFifteen" onchange="uploadImg(this.id,'14');" accept="image/*" capture="camera" />
                           <s:hidden id="imgFifteenId" name="merinfo.pictrueList[14].Url" />
                            <a rel="YLlightbox"  href="<s:if test="merinfo.pictrueList.size()>14"><s:property value="merinfo.pictrueList[14].Url"/></s:if>" style="<s:if test="merinfo.pictrueList.size()>14">display:block;</s:if>">  
                                <img src="<s:if test="merinfo.pictrueList[14].Url!=null"><s:property value="merinfo.pictrueList[14].Url"/></s:if>" />
                            </a>
                            <i class="delete-pic" style="<s:if test="merinfo.pictrueList.size()>14">display:inline;</s:if>"></i>
                        </div>
                        <div class="tb-normal" id="divFifteen">请上传备注7照片</div>
                    </td>
                    <td class="tb-td">
                        <div class="pic-uploading" id="bbbbbbbb">
                            <p>备注8</p>
                            <input type="file" name="file" id="imgSixteen" onchange="uploadImg(this.id,'15');" accept="image/*" capture="camera" />
                           <s:hidden id="imgSixteenId" name="merinfo.pictrueList[15].Url" />
                            <a rel="YLlightbox"  href="<s:if test="merinfo.pictrueList.size()>15"><s:property value="merinfo.pictrueList[15].Url"/></s:if>" style="<s:if test="merinfo.pictrueList.size()>15">display:block;</s:if>">  
                                <img src="<s:if test="merinfo.pictrueList[15].Url!=null"><s:property value="merinfo.pictrueList[15].Url"/></s:if>" />
                            </a>
                            <i class="delete-pic" style="<s:if test="merinfo.pictrueList.size()>15">display:inline;</s:if>"></i>
                        </div>
                        <div class="tb-normal" id="divSixteen">请上传备注8照片</div>
                    </td>
                </tr>
            </tbody>
		</table><input  id="clickInp" style="display: none;"/>
    </div>
    <div id="subBtn" align="center" class="line-submit bg-gray">
    	<label class="tb-input-submit"  >
			<input id="submitBtn" type="submit" value="提交"/>
        </label>
    </div>
</div>
</s:form> 
<%-- <s:iterator value="#request.posType" var="pos">
	<s:property value="#pos.key"/>
	<s:property value="#pos.value"/>
</s:iterator>1111 --%>
<script>
	$(document).ready(function(){
		$("#inputAccountNo").bind("blur",queryAgent);
		$("#inputOneOrgName").bind("blur",queryOneOrgName);
		$("#feePctMax1").bind("blur",checkD0JFeePctMax1);
		$("#feeAPerchent1").bind("blur",checkD0JServiceFee);
	});
	function queryAgent(){
		var accountNo = $("#inputAccountNo").val(); 
		$.ajax({
			url:'<c:url value="/mer/getDlpOpertorsByAccountNo.ct" />',
	  		data:{"accountNo":accountNo},
	  		dataType:"json",
	  		type:"POST",
	  		success:function(result){
	  			if(result.code == "success"){
	  				 $("#developPerson").val(result.message);
	  			}else{
	  				console.log(result);
	  				alert(result.message);
	  			}
	  		},error:function(rsg){
	  			alert("发展人账号对应发展人不存在");
	  		}
		});
	}
	
	//校验间联直营商户D0借记卡封顶值及代付服务费
	function checkD0JFeePctMax1(){
			var d0feePctMax = $("#feePctMax1").val();
			if($("input[name='merinfo.productCode']")[1].checked){
				if(d0feePctMax > 0){
					if((d0feePctMax < 20) || (d0feePctMax > 999)){
						alert("D0借记卡手续费封顶值不正确！请设置为0(无封顶)或者设置在20~999范围内！");
						return false;
					}else{
						$("#serviceFee").show();
						if(!checkD0JServiceFee()){
							return false;
						}
					}
				}else if(d0feePctMax == 0){
					$("#feeAPerchent1").val("");
					$("#serviceFee").hide();
				}else{
					alert("D0借记卡手续费封顶值不能小于0！");
					return false;
				}
			}
			return true;
	}
	
	function checkD0JServiceFee(){
		var feeAPerchent1 = $.trim($("#feeAPerchent1").val());
		if(feeAPerchent1.length == 0){
			$("#feeAPerchent1").val("0.03");
		}else{
			if((feeAPerchent1 < 0.03) || (feeAPerchent1 > 0.99)){
			alert("代付服务费费率不正确！正确范围0.03~0.99");
			return false;
		}
		}
		return true;
	}
	
	function checkMccCd(){
		var mccMap = $("#mccListHidden").val();
  		var mccMapArray = mccMap.substring(1,mccMap.length-1).split(",");
  		var mccCode=$("#showMccName").val().trim();
  		var flagMcc=0;
        for(var i=0;i<mccMapArray.length-1;i++){
        	if(mccCode==mccMapArray[i].trim()){
        		flagMcc=1;
        		return true;
        	}
        }
        if(flagMcc==0){
   		 $("#showMccName").val('');
		 return false;}
        else{
        	return true;
        }
	}
	var currentTerNum=1;
	var cifscanChecked = false;
	var isNum=0;
	$(function () {
		var mchtRejectType = '${mchtRejectType}';
			if(mchtRejectType == '2'){
				$("#subBtn").hide();
			}else{
				$("#subBtn").show();
			}
		$("#merName").blur(function(){	//校验商户简称
			checkMerName(this.value);
		});
		if($("#groupCd").val()=="2"){ //初始化页面判断证件有效期
			var certifValidit = $("input[name='merinfo.mchtExtendInfo.certifValidity']:checked").val();
			if(certifValidit =="0"){
				$("#certifStartDate").attr("readonly",true);
				$("#certifEndDate").attr("readonly",true);
			}
			var busiLiceValidit = $("input[name='merinfo.mchtExtendInfo.busiLiceValidity']:checked").val();
			if(busiLiceValidit =="0"){
				$("#busiLiceStartDate").attr("readonly",true);
				$("#busiLiceEndDate").attr("readonly",true);
			}
		}
		$('input:radio[name="merinfo.mchtExtendInfo.certifValidity"]').change(function(){	//身份证有效期
			var certifValidit = $("input[name='merinfo.mchtExtendInfo.certifValidity']:checked").val();
			if(certifValidit == "1"){
				$("#certifStartDate").attr("readonly",false);
				$("#certifEndDate").attr("readonly",false);
			}else{
				$("#certifStartDate").val("");
				$("#certifEndDate").val("");
				$('#certifStartDate').rules('remove');
				$('#certifEndDate').rules('remove');
				$("#certifStartDate").attr("readonly",true);
				$("#certifEndDate").attr("readonly",true);
			}
		});
		$('input:radio[name="merinfo.mchtExtendInfo.busiLiceValidity"]').change(function(){	//营业执照有效期
			var busiLiceValidit = $("input[name='merinfo.mchtExtendInfo.busiLiceValidity']:checked").val();
			if(busiLiceValidit == "1"){
				$("#busiLiceStartDate").attr("readonly",false);
				$("#busiLiceEndDate").attr("readonly",false);
			}else{
				$("#busiLiceStartDate").val("");
				$("#busiLiceEndDate").val("");
				$('#busiLiceStartDate').rules('remove');
				$('#busiLiceEndDate').rules('remove');
				$("#busiLiceStartDate").attr("readonly",true);
				$("#busiLiceEndDate").attr("readonly",true);
			}
		});
		if(!$("input[name='merinfo.productCode']")[1].checked){
			$("#feePercent1").val("0");$("#feePercent3").val("0");
			$("#feePctMax1").val("0");$("#feeAPerchent1").val("");
		}else{
			if($("#feeAPerchent1").val().length > 0){
				$("#serviceFee").show();
			}
		}
		
		if($("#merGroupCdEdit").val() != '1'){
		//页面加载带出银联扫码、支付宝微信产品手续费显示
		if($("input[name='merinfo.productCode']")[2].checked){
				cifscanChecked = true;
				addYinLianTr();
		}
		if($("input[name='merinfo.productCode']")[3].checked){
				$("#zwPaytr").remove();
				var zwPayRate = '${zwPayRate}';
				var tr = getTr_productCode('zwPaytr','支付宝微信扫码手续费',6,zwPayRate);	
				$("#mccTr").before(tr);	//添加模板
				$("#feePercent6").removeAttr('readonly');
			}
		}
    	//***********************************************************************css
        $('#tabBody').on('click', '.tab-title .tb-title', function () {
            var $this = $(this); /// 点击的对象
            var index = $this.index();  // 点击对象的下标
            $this.addClass('active').siblings().removeClass('active'); // 点击的对象添加active，同类对象移除active
            $('#tabBody').find('.tab-cnt .tb').eq(index).show().siblings().hide(); // 查找与点击对象相同关系的列表显示并隐藏同类对象
        });
        $('.delete-pic').on('click',deleteImage);
        	loadInstalledCity();
        var proCode=$("#areaCode").val();  
        if(proCode==null || proCode.length==0){
        	loadCity(null);//city; 
        }else{
       		 loadCity(proCode);//city; 
        }
        $("#dvpBy").change(function() { 
       	 if(this.value=="0"){
       		//alert(this.value);
       		//$("#unincorporated").html("");
       		$("#stlm").attr("disabled",true);
       	}else{
       		//var htmls=add_code();
       		//alert(this.value);
       		//$("#unincorporated").append(htmls);
       		 $("#stlm").removeAttr("disabled");
       	} 
		});

		//mcc为空时移除银联扫码手续费表单
		$("#showMccName").bind("input propertychange", function() { 
			var value = $(this).val().trim();
			if(value == ''){
				$("#showMccCode").val('');
				$("#cifScantr").remove();
			}
		}); 
		//zhang hu  shu xing 
		$("input[name='merinfo.approvalUserName']:radio").click(function(){
		   	   if(this.value=="1"){
		   		   $("#dvpBy").attr("disabled",true);
		   		   $("#stlm").attr("disabled",true);
		   		   //$("#isPrivate").html("");  
		   	   } else{
		   		   var htmls=isPrivate_code();
		   		   $("#dvpBy").removeAttr("disabled");
		   		   $("#stlm").removeAttr("disabled");
		   	   }
   	  	}); 
        $("#terminalDiv").click(function(){ 
        	var table=$("#posTable").get(0);
        	var count=50;
        	var lengths=table.rows.length;  
        	if(lengths >= count*2+1){
        		alert("提示：初次进件最多添加50台终端信息！");
				return false;
			} 
         	var htmls=jsp_code(lengths);
		    $("#posTable").append(htmls);
		    currentTerNum=currentTerNum+1;
        }); 
        $("input[name='merinfo.productCode']").click(function(){
        	isNum=0;
        	var currentChecked=this.checked;
        	var currentChoose=this.value;
        	var merGroupCdEdit = $("#merGroupCdEdit").val();
        	//alert(currentChecked+"/"+currentChoose);
        	if(currentChecked==true && currentChoose=='1171'){
        		$("#feePercent1").val("0.6");$("#feePercent3").val("0.6");
        		if(!checkD0JFeePctMax1()){
    				return false;
    			}
        		$("input[name='merinfo.productBean.transCd']").each(function(){
        			if(this.value=="1171"){
        				this.checked=true;
        			}
        		});
        	}else if (currentChecked==false && currentChoose=='1171'){
        		$("#feePercent1").val("0");$("#feePercent3").val("0");
        		$("#feePctMax1").val("0");$("#feeAPerchent1").val("");$("#serviceFee").hide();
        		$("input[name='merinfo.productBean.transCd']").each(function(){
        			if(this.value=="1171"){
        				this.checked=false;
        			}
        		});
        	}else  if(currentChecked==true && currentChoose=='1000'){
        		$("input[name='merinfo.productBean.transCd']").each(function(){
        			if(this.value!="1171"){
        				this.checked=true;
        			}
        		});
        	}else if (currentChecked==false && currentChoose=='1000'){
        		$("input[name='merinfo.productBean.transCd']").each(function(){
        			if(this.value!="1171"){
        				this.checked=false;
        			}
        		});
        	}else if (currentChecked==true && currentChoose=='1191'){	//银联扫码
				cifscanChecked = true;
				addYinLianTr();	//添加模板
			}else if (currentChecked==false && currentChoose=='1191'){
				cifscanChecked = false;
				$("#cifScantr").remove();
			}else if (currentChecked==true && currentChoose=='1391'){	//支付宝微信
				$("#zwPaytr").remove();
				var tr = getTr_productCode('zwPaytr','支付宝微信扫码手续费',6,0.38);	
				$("#mccTr").before(tr);	//添加模板
				$("#feePercent6").removeAttr('readonly');
			}else if (currentChecked==false && currentChoose=='1391'){
				$("#zwPaytr").remove();
			}else if(merGroupCdEdit == '1' && currentChecked==true && currentChoose=='1271'){
				$("#feePercent1").val("0.6");$("#feePercent3").val("0.6");
				$("input[name='merinfo.productBean.transCd']").each(function(){
					if(this.value=="1271"){
						this.checked=true;
					}
				});
			}else if(merGroupCdEdit == '1' && currentChecked==false && currentChoose=='1271'){
				$("#feePercent1").val("0");$("#feePercent3").val("0");
				$("input[name='merinfo.productBean.transCd']").each(function(){
					if(this.value=="1271"){
						this.checked=false;
					}
				});
			}else if(merGroupCdEdit == '1' && currentChecked==true && currentChoose=='3000'){
				$("input[name='merinfo.productBean.transCd']").each(function(){
					if(this.value!="1271"){
					this.checked=true;
					}
				});
			}else if(merGroupCdEdit == '1' && currentChecked==false && currentChoose=='3000'){
				 $("input[name='merinfo.productBean.transCd']").each(function(){
					if(this.value!="1271"){
						this.checked=false;
					}
				});
			}
			var checkLen=$("input[name='merinfo.productCode']:checked").length;
			if(checkLen==0){
				$("#isError").html("");
				return;
			}
			if(!$("input[name='merinfo.productCode']")[0].checked){	//校验T+1是否选中
				isNum = 1;
				$("#isError").html("T+1必选");
			}else{
				$("#isError").html("");
			}
		});
	
		$("#bhcertifType").change(function(){	//法人证件号码-身份证外的证件格式不做校验
			if($("#bhcertifType").val() == '01'){
				 $('#bhcertifNo').rules('add',{
					 isIdCardNo : true,
					 messages:{
						isIdCardNo: '证件格式不正确',
					}
					});
			}else{
				$('#bhcertifNo').rules('remove'); 
				 $('#bhcertifNo').rules('add',{
					 required : true,
					 messages:{
						 required: '必填',  
					}
					});
			}
		});
		
		$("#dmerinfoForm").validate({
			debug : true,
			submitHandler : function(form) {
				if($("#isMid").val()==null || $("#isMid").val()=="" || $("#clickInp").val()=="1"){
					alert("加载信息异常");
					return false;
				}
				if(!checkMerName($("#merName").val())){
					return false;
				}
				if($("#rtName").html()!="" || $("#rtName").html().length>5){
					return false;
				}
				if(isNum == 1){
					alert("产品开通T+1必选");
					return false;
				}
				if($("#groupCd").val()=="2"){
					var certifValidit = $("input[name='merinfo.mchtExtendInfo.certifValidity']:checked").val();
					var busiLiceValidit = $("input[name='merinfo.mchtExtendInfo.busiLiceValidity']:checked").val();
					if(certifValidit == "1"){
						var certifStartDate = $("#certifStartDate").val();
						var certifEndDate = $("#certifEndDate").val();
						if(certifStartDate==null || certifStartDate.length==0 || certifEndDate==null || certifEndDate.length==0){
							alert("身份证有效期不能为空！");
							return false;
						}
						if(!checkCreValidity(certifStartDate)){
							return false;
						}
						if(!checkCreValidity(certifEndDate)){
							return false;
						}
					}
					if(busiLiceValidit == "1"){
						var busiLiceStartDate = $("#busiLiceStartDate").val();
						var busiLiceEndDate = $("#busiLiceEndDate").val();
						if(busiLiceStartDate==null || busiLiceStartDate.length==0 || busiLiceEndDate==null || busiLiceEndDate.length==0){
							alert("营业执照有效期不能为空！");
							return false;
						}
						if(!checkCreValidity(busiLiceStartDate)){
							return false;
						}
						if(!checkCreValidity(busiLiceEndDate)){
							return false;
						}
					}
				}
				if(!checkD0JFeePctMax1()){
					return false;
				}
				$("#submitBtn").attr("disabled",true);
				form.submit();
			},
			rules : {
				"merinfo.nameBusi" : {required : true},   
				"merinfo.name" : {required : true}, //所属地区
				"merinfo.provCd" : {required : true},  
				"merinfo.areaCd" : {required : true}, 
				"merinfo.cityCd" : {required : true},  
				"merinfo.regAddr" : {required : true},  
				"merinfo.certif":{required:true},
				"merinfo.busiLiceNo" : {required : true,isABC:true}, //merinfo  name
				"merinfo.certifType" : {required : true}, 
				"merinfo.certifNo" : {required : true, isIdCardNo:true},
				"merinfo.contactName" : {required : true},
				"merinfo.contactPhoneNo" : {required : true,isMobile :true},
				"merinfo.terminfoRisk.AccpetStartTime" : {required : true},
				"merinfo.terminfoRisk.AccpetEndTime" : {required : true},
				"merinfo.busiMain":{required:true},
				"merinfo.nationCd":{required:true},
				"merinfo.dvpBy": {required : true},
				"merinfo.stlmWayDesc": {required : true,isIdCardNo:true},
				"merinfo.bankAccount.name":{required: true},
				"merinfo.bankAccount.account":{required: true,isNumber:true},
				"merinfo.bankAccount.bankName":{required:true},
				"merinfo.bankAccount.bankCode":{required: true},
				"provice32":{required:true},
				"merinfo.ucBccd":{required:true},
				"merinfo.terminfoList[0].TmnlMoney":{required:true,maxNumber:true},
				"merinfo.terminfoList[1].TmnlMoney":{required:true,maxNumber:true},
				"merinfo.terminfoList[2].TmnlMoney":{required:true,maxNumber:true},
				"merinfo.terminfoList[3].TmnlMoney":{required:true,maxNumber:true},
				"merinfo.terminfoList[4].TmnlMoney":{required:true,maxNumber:true},
				"merinfo.terminfoList[0].Installlocation":{required:true},
				"merinfo.terminfoList[1].Installlocation":{required:true},
				"merinfo.terminfoList[2].Installlocation":{required:true},
				"merinfo.terminfoList[3].Installlocation":{required:true},
				"merinfo.terminfoList[4].Installlocation":{required:true},
				"merinfo.productCode":{required:true},
				"mccNameValidate":{required:true},
				"merinfo.fee[0].mchtFeePercent":{required:true,isDecimal: function(){
					var min= 0.450;		var max = 0.999;	var accuracy = 3;
					return [min, max, accuracy];
					
				}},
				"merinfo.fee[0].mchtFeePctMax":{required:true,isDecimal: function(){
					var min= 18;		var max = 999; var accuracy = 3;
					return [min, max,accuracy];
				}},
				"merinfo.fee[1].mchtFeePercent":{required:true,isDecimal: function(){
					var min = 0.550;	var max = 0.999;	var accuracy = 3;
					return [min, max, accuracy];}},
				"merinfo.fee[2].mchtFeePercent":{required:true,isDecimal: function(){
					var min=0.000;
					if($("input[name='merinfo.productCode']")[1].checked){
						min=0.550;
					}
					var max = 0.999;	var accuracy = 3;
					return [min, max, accuracy];}},
				"merinfo.fee[2].mchtFeePctMax":{required:true,isDecimal: function(){
						var min= 0;		var max = 999; var accuracy = 3;
						return [min, max,accuracy];
				}},	
				"merinfo.fee[3].mchtFeePercent":{required:true,isDecimal: function(){
					var min=0.000;
					if($("input[name='merinfo.productCode']")[1].checked){
						min=0.550;
					}
					var max = 0.999;	var accuracy = 3;
					return [min, max, accuracy];}},
				"merinfo.fee[6].mchtFeePercent":{required:true,isDecimal: function(){
					var min = 0.300;	var max = 0.999;	var accuracy = 3;
					return [min, max, accuracy];}},
				"merinfo.pictrueList[0].Url":{required: true},
				"merinfo.pictrueList[1].Url":{required: true},
				"merinfo.pictrueList[2].Url":{required: true},
				"merinfo.pictrueList[3].Url":{required: true},
				"merinfo.pictrueList[4].Url":{required: true},
				"merinfo.pictrueList[5].Url":{required: true},
				"merinfo.pictrueList[6].Url":{required: true},
				"merinfo.pictrueList[7].Url":{required: true},
				"merinfo.bankBelongCd":{required: true},
				"merinfo.ext1":{required: true}
			},
			messages : {
				"merinfo.nameBusi" : {required : "必填"},   
				"merinfo.name" : {required : "必填"}, //所属地区
				"merinfo.provCd" : {required : "必选"},  
				"merinfo.areaCd" : {required : "必选"}, 
				"merinfo.cityCd" : {required : "必选"},  
				"merinfo.regAddr" : {required : "必填"},  
				"merinfo.certif":{required: "必填"},
				"merinfo.busiLiceNo" : {required : "必填"}, //merinfo  name
				"merinfo.certifType" : {required : "必填"}, 
				"merinfo.certifNo" : {required : "必填",isIdCardNo: "证件格式不正确",},
				"merinfo.contactName" : {required : "必填"},
				"merinfo.contactPhoneNo" : {required : "必填",isMobile:"格式不正确"},
				"merinfo.terminfoRisk.AccpetStartTime" : {required : "必填"},
				"merinfo.terminfoRisk.AccpetEndTime" : {required :  "必填"},
				"merinfo.busiMain":{required: "必填"},
				"merinfo.nationCd":{required: "必填"},
				"merinfo.dvpBy" : {required : "必填"},
				"merinfo.stlmWayDesc": {required : "必填",isIdCardNo: "证件格式不正确"},
				"merinfo.bankAccount.name":{required: "必填"},
				"merinfo.bankAccount.account":{required: "必填"},
				"merinfo.bankAccount.bankName":{required: "必选"},
				"merinfo.bankAccount.bankCode":{required: "必选"},
				"provice32":{required:"必选"},
				"merinfo.ucBccd":{required:"必选"},
				"merinfo.terminfoList[0].TmnlMoney":{required: "必填"},
				"merinfo.terminfoList[1].TmnlMoney":{required: "必填"},
				"merinfo.terminfoList[2].TmnlMoney":{required: "必填"},
				"merinfo.terminfoList[3].TmnlMoney":{required: "必填"},
				"merinfo.terminfoList[4].TmnlMoney":{required: "必填"},
				"merinfo.terminfoList[0].Installlocation":{required: "必填"},
				"merinfo.terminfoList[1].Installlocation":{required: "必填"},
				"merinfo.terminfoList[2].Installlocation":{required: "必填"},
				"merinfo.terminfoList[3].Installlocation":{required: "必填"},
				"merinfo.terminfoList[4].Installlocation":{required: "必填"},
				"merinfo.productCode":{required:"必选"},
				"mccNameValidate":{required:"必选"},
				"merinfo.fee[0].mchtFeePercent":{required:"必填"},
				"merinfo.fee[0].mchtFeePctMax":{required:"必填",min:"最低18",max:"最高999"},
				"merinfo.fee[1].mchtFeePercent":{required:"必填"},
				"merinfo.fee[2].mchtFeePercent":{required:"必填"},
				"merinfo.fee[2].mchtFeePctMax":{required:"必填"},
				"merinfo.fee[3].mchtFeePercent":{required:"必填"},
				"merinfo.fee[6].mchtFeePercent":{required:"必填"},
				"merinfo.pictrueList[0].Url":{required:"未上传"},
				"merinfo.pictrueList[1].Url":{required:"未上传"},
				"merinfo.pictrueList[2].Url":{required:"未上传"},
				"merinfo.pictrueList[3].Url":{required:"未上传"},
				"merinfo.pictrueList[4].Url":{required:"未上传"},
				"merinfo.pictrueList[5].Url":{required:"未上传"},
				"merinfo.pictrueList[6].Url":{required:"未上传"},
				"merinfo.pictrueList[7].Url":{required: "未上传"},
				"merinfo.bankBelongCd":{required: "必填"},
				"merinfo.ext1":{required: "必填"}
			},errorPlacement: function(error, element) { 
			    if ( element.is(":radio") ) error.appendTo ( element.parent() ); 
			    else if ( element.is(":checkbox") ) error.appendTo ( element.parent() ); 
			    else if ( element.is("input") ) error.appendTo ( element.parent().next() ); 
			    else if ( element.is("select") ) error.appendTo ( element ); 
			    else error.insertAfter(element); 
			} 
		});
		
	});
	
	window.onload = function() {
		if($("#bhcertifType").val() != '01'){
			$('#bhcertifNo').rules('remove'); 
			 $('#bhcertifNo').rules('add',{
				 required : true,
				 messages:{
					 required: '必填',  
				}
				});
		}
	}; 
	
	function deleteRows(input){
		var a=input.parentNode.parentNode.rowIndex; 
		var table=$("#posTable").get(0);
		table.deleteRow(a);
		table.deleteRow(a-1);
		
	}
  
     function jsp_code(lengths){
    	 
    	var select="<select name='merinfo.terminfoList["+parseInt(lengths/2-1)+"].TermTp'>";
    	 
    	 <s:iterator value="#request.posType" var="pos">
    	 	var key="<s:property value="#pos.key"/>";
    	 	var value="<s:property value="#pos.value"/>";
    	 	select=select+"<option value='"+key+"'>"+value+"</option>";
    	 </s:iterator> 
     	 select=select+"</select>";
    	  
    	  var htmls= "<tr class='tb-line'>"
		+"<td style='width: 110px' align='right' class='tb-td'><div class='tb-h4'>终端类型：</div></td>"
		+"<td class='tb-td'><label class='tb-input-lengthen'>"+select
		+"</label><code class='asterisk'>*</code></td>"
		+"<td  style='width: 110px'align='right' class='tb-td'><div class='tb-h4'>终端接入方式：</div></td>"
		+"<td class='tb-td'  align='left'> "
		+"<input name='merinfo.terminfoList["+parseInt(lengths/2-1)+"].TmnlIntype' type='radio' checked='checked' value='0' />无线(GPRS)<input name='merinfo.terminfoList["+parseInt(lengths/2-1)+"].TmnlIntype' type='radio' value='1' />有线(拨号)"
		+"<code class='asterisk'>*</code></td></tr>"
		+"<tr class='tb-line'>"
		/* +"<td style='width: 110px' align='right' class='tb-td' ><div class='tb-h4'>押金金额：</div></td>"
		+"<td class='tb-td'><label class='tb-input-normal'><input name='merinfo.terminfoList["+parseInt(lengths/2-1)+"].TmnlMoney' value='0' maxLength='10'/></label><code class='asterisk'>*</code></td>" */
		+"<td style='width: 110px' align='right' class='tb-td'><div class='tb-h4'>装机地址：</div></td>"
		+"<td class='tb-td' colspan='3' ><label class='tb-input-lengthen'><input  name='merinfo.terminfoList["+parseInt(lengths/2-1)+"].Installlocation' type='text' maxLength='30'/></label>"
		+"<code class='asterisk'>*</code> "
        +"<input id='' type='button' onclick='deleteRows(this)'  value=' 删    除 'style='magin-left:30px;'/></td></tr>";
		return htmls;  
    }
     function showPosInfoWindow(){
    	    
         var ScreenWidth = screen.availWidth ;
         var ScreenHeight = screen.availHeight; 
         var StartX = (ScreenWidth - innerWidth) / 2 ;
         var StartY = (ScreenHeight - innerHeight) / 2 ;
    	 var url =  '<s:url value="/chooseBank/init.ct"/>';
    	 window.open(url, '选择开户行', 'left='+ StartX + ', top='+ StartY + ', Width=' + innerWidth +', height=' + innerHeight + ', resizable=no, scrollbars=yes, status=no, toolbar=no, menubar=no, location=no'); 
    } 
     function textCounter(obj,max){
    	 if(obj.value.length>max){
    		 obj.value=obj.value.substring(0,max);
    	 }
     }
     
     function add_code(){
    	 var htmls="<label class='tb-input-lengthen'>"
    	 +"<input  id='no' maxlength='20' name='merinfo.stlmWayDesc' class='queryWidth' />" 
    	 +"</label>"
    	 +"<font color='red'><span id='xh'>*</span></font>";
    	 return htmls;
     }
     
     function isPrivate_code(){//不能用struts标签
    	 var htmls=
			"<td align='right' class='tb-td' style='width:110px;'>"
     		+"<div class='tb-h4'>是否法人结算：</div></td>"
     		+"<td class='tb-td' >"
     		+"<label class='tb-select'>"
      		+"<select id='dvpBy' name='merinfo.dvpBy'>"
			+"<option value='0'>是</option>"
			+"<option value='1'>否</option>"
			+"</select></label>"
			+"<font color='red'>*</font></td>"
			+"<td align='right' class='tb-td' >"
     		+"<div class='tb-h4' id='ff'>非法人身份证号：</div></td>"
     		+"<td class='tb-td' id='unincorporated'>"
      	 	+"<label  class='tb-input-lengthen'>"
      		+"<input  id='no' maxlength='20' name='merinfo.stlmWayDesc' class='queryWidth' /></label>" 
      		+"<font color='red'><span id='xh'>*</span></font></td>"; 
    		return htmls;
     }
     
     $(function() {
   	  //加载银行
   	var bankMap = $("#bankListHidden").val();
   	var bankMapArray = bankMap.substring(1,bankMap.length-1).split(",");
   	/* alert(bankMapArray[0]+" "+bankMapArray[0].length); */
 		$( "#tags" ).autocomplete({
 			source: bankMapArray ,select:function(event,ui){
 				$("#aaa").val("");
 				$("#bbb").val("");
 				var optionValue = ui.item.value;
 				if(optionValue){
 					obtainSomeBank(optionValue);
 				}
 			} 
 		});
 		
 		//加载Mcc
 		var mccMap = $("#mccListHidden").val();
 		var mccMapArray = mccMap.substring(1,mccMap.length-1).split(",");
 		$( "#showMccName" ).autocomplete({
 			source: mccMapArray,select:function(event,ui){
 				var mccOptionValue = ui.item.value;
 				var mccValArray = mccOptionValue.split("_");
 				$("#showMccCode").val($.trim(mccValArray[0]));
 				addYinLianTr();
 			}
 		});
 		 
 		
 	});
   
  /*  $("#aaa").focus(function(){
   	var optionValue = $.trim($("#tags").val());
   	if(!optionValue){
   		alert("请先在第一个输入框中选择银行后再选择支行");
   	}
   }); */
	function obtainSomeBank(mvalue) {
		
		var valArray = mvalue.split("_");
		BankQuery.loadBankInfo($.trim(valArray[0]), function(objs) {
			var someBankNameArray = [];
			for(var i=0;i<objs.length;i++){
				someBankNameArray.push(objs[i].name);
			}
			$("#aaa").autocomplete({
				source : someBankNameArray,select:function(event,ui){
					var zhBankName = ui.item.value;
					for(var i=0;i<objs.length;i++){
						if(zhBankName == objs[i].name){
							$("#bbb").val(objs[i].code);
							break;
						}
					}
				}
			})
			

		});
	}

	//动态添加银联扫码手续费表单
	/* function addYinLianTr(){
		if(cifscanChecked){
			//var mccName = $( "#showMccCode" ).val().trim(); 
			var code = $("#showMccCode").val();
			if(code==null || code.length<1){
				return;
			} 
			var arr = ['6011','6012','6013','6014','9498'];
			if(code != ''){
				var index = $.inArray(code, arr);
				if(index >= 0){
					var tr = getTr_productCode('cifScantr','银联扫码手续费',5,0.6);
					$("#cifScantr").remove();
					$("#creditCardtr").after(tr);
					$("#feePercent5").attr('style','background-color:lightgray;');
				}else{
					var tr = getTr_productCode('cifScantr','银联扫码手续费',5,0.35);
					$("#cifScantr").remove();
					$("#creditCardtr").after(tr);
					$("#feePercent5").attr('style','background-color:lightgray;');
				}
			}
		}
	} */
	
	//动态添加银联扫码手续费表单
	function addYinLianTr(){
		if(cifscanChecked){
			var code = $("#showMccCode").val();
			if(code==null || code.length<1){
				return;
			} 
			if(code != ''){
				var tr = getTr_productCode('cifScantr','银联扫码手续费',5,0.6);
				$("#cifScantr").remove();
				$("#creditCardtr").after(tr);
				$("#feePercent5").attr('style','background-color:lightgray;');
			}
		}
	}

	//产品费率表单模板
	function getTr_productCode(id,label,num,value){
		var tr = "<tr class='tb-line' id='"+id+"'>"
		+"<td width='10%' style='min-width: 150px' align='right' class='tb-td'>"
		+"<div class='tb-h4'>"+label+"：</div>"
		+"</td>"
		+"<td  align='left' class='tb-td' colspan='3' >"
		+"<label class='tb-input-mini'>"
		+"<input id='feePercent"+num+"' name='merinfo.fee["+num+"].mchtFeePercent' value='"+value+"' readonly='true' />"
		+" </label>%<span></span> - <span></span>"
		+"<label class='tb-input-mini'>"
		+" <input id='feePctMax"+num+"' name='merinfo.fee["+num+"].mchtFeePctMax' value='0' readonly='true' style='background-color:lightgray;'/>"
		+" </label>封顶 "
		+"	</td></tr>";
		return tr;
	}
	
	//校验商户简称
	function checkMerName(val){
		if(val.length == 0){
			$("#checkName").html("");
			return false;
		}else{
			var regx = /^[a-zA-Z0-9\u4e00-\u9fa5]{8,20}$/;
			if(!regx.test(val)){
				$("#checkName").html("只能输入汉字、字母、数字且 8~20位！");
				return false;
			}else{
				$("#checkName").html("");
			}
		}
		return true;
	}
	
	function loadInstalledCity(){
		var url=window.location.host; 
		var protocol=window.location.protocol+"//";
		$("#chooseCity").empty();
		$("#chooseCity").append("<option value=''>请选择</option>");
		var is=$("#chooseProvice").val();
		var param={"proviceCode":is};
		$.ajax({
			url:protocol+url+"/fmposm/address/getCityMap.ct",
			data:param,
			dataType:"text",
			type:"POST",
			success:function(returnResult){ 
				var a=jQuery.parseJSON(returnResult);
				for ( var b in a[0]) {
					$("#chooseCity").append("<option value='"+b+"'>"+ a[0][b]+ "</option>");
				}
				//加载32域
				var areaCityCode = $("#areaCityCode").val();
				$("#chooseCity option").each(function(){ 
					if(this.value == areaCityCode){
						$(this).attr("selected", "selected");
					}
				});
			},error:function(rsg){
				alert("加载城市出错，请联系客服~！");
			}	
		});	
	}
	
	function checkCreValidity(valueStr){
		var certifValidit = $("input[name='merinfo.mchtExtendInfo.certifValidity']:checked").val();
		var busiLiceValidit = $("input[name='merinfo.mchtExtendInfo.busiLiceValidity']:checked").val();
		if(certifValidit == "1" || busiLiceValidit == "1"){ 
			var vdate = /^\d{4}[-]\d{2}[-]\d{2}$/;
			if(!vdate.test(valueStr)){
				alert("证件有效期格式请输入为yyyy-mm-dd！");
				return false;
			}
		}
		return true;
	}
	
	</script>
</body>
</html>